package com.rpc.example.controller;

import com.rpc.example.annotation.RpcRemoteReference;
import com.rpc.example.api.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @RpcRemoteReference(serviceName = "provider-service")
    private IUserService userService;

    @GetMapping("saveUser")
    public String saveUser() {
        return userService.saveUser("JACK CHOU");
    }

    @GetMapping("queryById")
    public String queryById() {
        return userService.getById(10000L);
    }
}
